package com.venus.lms.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.venus.lms.mapper.BookWithUserMapper;
import com.venus.lms.pojo.BookWithUser;
import com.venus.lms.service.BookWithUserService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * @author DQM
 */
@Service
@Transactional
public class BookWithUserServiceImpl extends ServiceImpl<BookWithUserMapper, BookWithUser> implements BookWithUserService {
    @Override
    public BookWithUser getBookWithUserByIsbn(String isbn) {
        LambdaQueryWrapper<BookWithUser> wrapper = Wrappers.lambdaQuery();
        //查找图书借阅记录里有没有要删除的书的编号
        wrapper.eq(BookWithUser::getIsbn, isbn);
        return baseMapper.selectOne(wrapper);
    }
}
